import 'package:flutter/material.dart';
import 'package:lib_uikit/generated/l10n.dart';
import 'package:lib_uikit/lib_uikit.dart';
import 'package:lib_uikit/theme/gt_colors_v3.dart';
import 'package:lib_uikit/widgets/bottomsheet/gt_bottom_sheet_v3.dart';

import '../text/gt_text.dart';

/// @Title   弹出标题内容文字列表bottomsheet
/// @Author: bryce
/// @CreateDate: 2023年10月18日16:09:54
Future<int?> showActionSheetDeleteV3(
  context, {
  String? title,
  String? delete,
  double? backgroundOpacity,
  VoidCallback? dismissCallBack,
  VoidCallback? onDeleteClick,
}) async {
  return showGTBottomSheetV3(context,
      showBottomCancel: false,
      showTopRightClose: false,
      title: null,
      leftPadding: 0,
      rightPadding: 0,
      bottomPadding: 0,
      backgroundOpacity: backgroundOpacity,
      dismissCallBack: dismissCallBack,
      child: Column(
        mainAxisSize: MainAxisSize.min,
        children: [
          Padding(
            padding: const EdgeInsets.only(left: 24, right: 24, top: 8, bottom: 16),
            child: Text(
              title ?? "",
              style: gtTextStyleW500(fontSize: 12, color: GTColorsV3.text2.color),
            ),
          ),
          Container(
            height: 1,
            color: GTColorsV3.divider2.color,
          ),
          const SizedBox(
            height: 8,
          ),
          GestureDetector(
            onTap: () {
              onDeleteClick?.call();
            },
            child: Container(
              color: GTColorsV3.cmpt16.color,
              height: 40,
              width: GTScreen.getWidth(context),
              alignment: Alignment.center,
              child: Text(
                delete ?? "",
                style: gtTextStyleW500(fontSize: 14, color: GTColorsV3.color3.color),
              ),
            ),
          ),
          const SizedBox(
            height: 8,
          ),
          Container(
            height: 4,
            color: GTColorsV3.bg2.color,
          ),
          SafeArea(
            child: GestureDetector(
              onTap: () {
                Navigator.pop(context);
              },
              child: Container(
                  color: GTColorsV3.cmpt16.color,
                  height: 48,
                  width: GTScreen.getWidth(context),
                  alignment: Alignment.center,
                  child: Text(
                    LibUIKitS.of(context).Cancel,
                    style: gtTextStyleW500(fontSize: 14, color: GTColorsV3.text1.color),
                  )),
            ),
          ),
        ],
      ));
}
